﻿using System;
using System.Text;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SZSLSystem.Web.Admin.SystemLog
{
    public partial class List : SZSLSystem.Web.UI.ManagePage
    {
        #region 全局变量

        /// <summary>
        /// 总条数
        /// </summary>
        public int pcount; 
        /// <summary>
        /// 当前页
        /// </summary>
        public int page; 
        /// <summary>
        /// 设置每页显示的大小
        /// </summary>
        public int pagesize;

        #endregion 

        protected void Page_Load(object sender, EventArgs e)
        {
            this.pagesize = webset.BackgroundPage;
            if (!Page.IsPostBack)
            {
                this.RptBind("", "AddDate desc");
            }
        }

        /// <summary>
        /// 绑定数据
        /// </summary>
        /// <param name="strWhere">查询条件</param>
        /// <param name="orderby">排序条件</param>
        private void RptBind(string strWhere,string orderby)
        {
            if (!int.TryParse(Request.Params["page"] as string, out this.page))
            {
                this.page = 0;
            }
            SZSLSystem.BLL.SystemLog bll = new SZSLSystem.BLL.SystemLog();
            pcount = bll.GetCount(strWhere);
            rptList.DataSource = bll.GetPageList(this.pagesize, this.page, strWhere, orderby);
            rptList.DataBind();
        }
    }
}
